use crate::app::UIComponent;
use eframe::egui;
use eframe::egui::{Align, Color32, Layout, Ui};

pub struct TabBar {}

impl TabBar {
    pub fn new() -> Self {
        Self {}
    }
}

impl UIComponent for TabBar {
    fn update(&mut self, ui: &mut Ui) {
        // tab页签
        egui::TopBottomPanel::top(ui.next_auto_id())
            .resizable(true)
            .show_inside(ui, |ui| {
                ui.add_space(5.);
                ui.with_layout(Layout::left_to_right(Align::LEFT), |ui| {
                    ui.colored_label(Color32::GOLD, "页签1");
                    ui.colored_label(Color32::RED, "页签2");
                });
                ui.add_space(5.);
            });
    }
}